package COF23.Factory.abstractFactory;

/**
 * @Package COF23.Factory.abstractFactory
 * @Author shimmer
 * @Date 2020/5/29 15:50
 * @TODO
 */
public class Consumer {
    public static void main(String[] args) {
        System.out.println("--------小米系列---------");
        // 通过创建小米工厂来获得手机和路由器
        XiaomiFactory xiaomiFactory = new XiaomiFactory();
        IphoneProduct iphone = xiaomiFactory.iphoneProduct();
        iphone.start();
        iphone.callUp();
        IRouterProduct router = xiaomiFactory.iRouterProduct();
        router.start();
        router.wifiUp();
        
        System.out.println("--------华为系列---------");
        XiaomiFactory huaweiFactory = new XiaomiFactory();
        IphoneProduct iphone1 = huaweiFactory.iphoneProduct();
        iphone1.start();
        iphone1.callUp();
        IRouterProduct router1 = huaweiFactory.iRouterProduct();
        router1.start();
        router1.wifiUp();
    }
}
